subroutine rtraj()
use var
use type
use parallel
implicit none
integer  :: ss,step,y,ioerr = 0 
character*20 :: string

do
read(111,IOSTAT=ioerr)string
if (ioerr == 0) then
   read(111)frame,ss,step,y
   read(111)ISEED  
   read(111)trj_E
   read(111)NP_position
   read(111)q
else
   exit
endif
enddo

write(*,*)"READ THE TRAJ FILE"
write(*,*)"Last frame"
write(*,*)"FRAME",frame,"CYCLE",ss,"STEP",step
end subroutine

